home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-68k-src / machines / amiga68k / libsrc / ixemul / make_ixemul.script < prev   
AmigaDOS Script File  |  1999-01-01  |  2KB  |  110 lines

  1. .key -sd/S,-debug/S
  2.  
  3. if not exists Make_ixemul.script
  4.   echo "Please change first to the script's directory!"
  5.   quit
  6. endif
  7.  
  8. if not exists gen_glue.c
  9.   echo "Missing gen_glue.c! Please copy it to the script's directory."
  10.   quit
  11. endif
  12.  
  13. if "<-sd>" EQ ""
  14.   set lbmodel large data
  15.   set alibnam ixemul.lib
  16.   set asflags QUIET
  17.   set ggflags no-baserel
  18. else
  19.   set lbmodel small data
  20.   set alibnam ixemuls.lib
  21.   set asflags QUIET SMALLDATA 4,-2 SET BASECRT0
  22.   set ggflags baserel
  23. endif
  24.  
  25. if "<-debug>" EQ "-debug"
  26.   set asflags $asflags SYMDEBUG
  27. endif
  28.  
  29. echo "Checking for required commands. Stopping if missing.*N"
  30.  
  31. failat 5
  32.   echo noline "which    : "
  33.     which which                 ;stop if missing. :-)
  34.   echo noline "copy     : "
  35.     which copy
  36.   echo noline "delete   : "
  37.     which delete
  38.   echo noline "execute  : "
  39.     which execute
  40.   echo noline "join     : "
  41.     which join
  42.   echo noline "list     : "
  43.     which list
  44.   echo noline "type     : "
  45.     which type
  46.   echo noline "vc       : "
  47.     which vc
  48.   echo noline "PhxAss   : "
  49.     which PhxAss
  50. failat 20
  51.  
  52. echo "*NCompiling $alibnam with $lbmodel model. This may take some time..."
  53.  
  54. if not exists gen_glue
  55.   vc -o gen_glue gen_glue.c
  56. endif
  57.  
  58. copy >nil: gen_glue T:
  59. cd > T:cdir
  60. cd T:
  61.  
  62. echo "*NGenerating stub sources..."
  63.   gen_glue $ggflags
  64.  
  65. echo "*NCopying support routines..."
  66.   copy vbcc:libsrc/ixemul/support/#?.s T: quiet
  67.  
  68. echo "*NAssembling stubs..."
  69.   resident >NIL: PhxAss REMOVE
  70.   resident `which PhxAss`
  71.   list #?.s LFORMAT "PhxAss %s $asflags" > asm.script
  72.   execute asm.script
  73.  
  74. echo "*NJoining everything together..."
  75.   join #?.o to $alibnam
  76.  
  77. echo "*NCleaning up..."
  78.   resident PhxAss REMOVE
  79.   cd `type T:cdir`
  80.   delete T:#?.s T:#?.o T:gen_glue T:cdir T:asm.script quiet
  81.  
  82. unset lbmodel
  83. unset asflags
  84. unset ggflags
  85.  
  86. set instto T:
  87.  
  88. which >nil: ask
  89. if not warn
  90.   ask "*NInstall $alibnam to vlib: (y/n)?"
  91.   if warn
  92.     set instto vlib:
  93.     failat 21
  94.     copy >nil: t:$alibnam $instto
  95.     if not fail
  96.       delete t:$alibnam quiet
  97.     endif
  98.     failat 20
  99.   endif
  100. endif
  101.  
  102. if exists ${instto}${alibnam}
  103.   echo "*N*N...poooh... $alibnam can be found in ${instto}."
  104. else
  105.   echo "*N*NInstallation error!"
  106. endif
  107.  
  108. unset instto
  109. unset alibnam
  110.